package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import pojo.Book;
import dao.BookDao;
import dao.impl.BookDaoImpl;
public class StoreServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private BookDao dao;
    public StoreServlet() {
        super();
        dao=new BookDaoImpl();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<Book> books=dao.findAll();
		request.setAttribute("books", books);
		request.getRequestDispatcher("store.jsp").forward(request, response);
	}

}
